import Mock from 'mockjs'

export default [
    {
        url: '/api/getUserList',
        method: 'get',
        response: () => {
            return Mock.mock({
                code: 200,
                'data|1-20': [
                    {
                        id: '@id',
                        name: '@cname',
                    },
                ],
            })
        },
    },
    {
        url: '/api/getMenuList',
        method: 'get',
        response: () => {
            return {
                code: 200,
                data: [
                    {
                        path: '/BasicLayout/Menu',
                        title: 'Menus',
                        name: 'Menus',
                        iconName: 'icon-appstore',
                        isMenu: true,
                        children: [
                            {
                                path: '/BasicLayout/Menus/Animejs',
                                component: '/views/Menus/Animejs/index',
                                name: 'menu-animejs',
                                title: 'Animejs',
                                isMenu: true,
                                keepAlive: true,
                                iconName: 'icon-Console-SQL',
                            },
                            {
                                path: '/BasicLayout/Menus/Demo',
                                component: '/views/Menus/Demo/index',
                                name: 'menu-Demo',
                                title: 'Demo',
                                isMenu: true,
                                keepAlive: true,
                                iconName: 'icon-fuwuqi',
                            },
                        ],
                    },
                ],
            }
        },
    },
    {
        url: '/api/getDept',
        method: 'get',
        response: () => {
            return Mock.mock({
                code: 200,
                'data|1-10': [
                    {
                        id: '@guid',
                        dept: '@ctitle',
                        'children|1-10': [
                            {
                                id: '@guid',
                                dept: '@ctitle',
                            },
                        ],
                    },
                ],
            })
        },
    },
    {
        url: '/api/getUserInfo',
        method: 'get',
        response: () => {
            return Mock.mock({
                code: 200,
                data: {
                    id: '@id',
                    name: '@cname',
                    dept: `@cword(4)部门`,
                },
            })
        },
    },
    {
        url: '/api/userLogin',
        method: 'get',
        response: () => {
            return Mock.mock({
                code: 200,
                result: '@guid',
            })
        },
    },
    {
        url: '/api/getDict',
        method: 'get',
        response: () => {
            return Mock.mock({
                code: 200,
                'data|20': [{ id: '@id', value: '@id', label: '@cname' }],
            })
        },
    },
    {
        url: '/api/getTableList',
        method: 'post',
        response: () => {
            return Mock.mock({
                code: 200,
                data: {
                    'records|20': [
                        {
                            id: '@id',
                            name: '@cname',
                            sfzh: '@id',
                            date: "@date('yyyy-MM-dd')",
                            city: '@city',
                            desc: '@cparagraph',
                        },
                    ],
                    total: 122,
                },
            })
        },
    },
    {
        url: '/api/getTreeDept',
        method: 'post',
        response: () => {
            return Mock.mock({
                code: 200,
                'data|10': [
                    {
                        id: '@guid',
                        name: '@cword(4)',
                        'children|13': [
                            {
                                id: '@guid',
                                name: '@cword(4)',
                            },
                        ],
                    },
                ],
            })
        },
    },
    {
        url: '/api/getUserList',
        method: 'post',
        response: () => {
            return Mock.mock({
                code: 200,
                data: {
                    'records|20': [
                        {
                            id: '@guid',
                            name: '@cname',
                            dept: '@cword(4)',
                        },
                    ],
                    total: 991,
                },
            })
        },
    },
]
